<template>
	<view>
		<view>顾客地址:{{customerAddress}}</view>
		<view>顾客经度:{{longitude}}</view>
		<view>顾客纬度:{{latitude}}</view>
		<view>高德返回格式化地址:{{formatted_address}}</view>
	</view>
</template>

<script>
	export default {
		onLoad:function(option){
			// console.log("接收上个页面传递的参数",option.address);
			// this.customerAddress=option.address;
			const self=this;
			console.log("接收上个页面传递的参数",option.address);
			this.customerAddress=option.address;
			uni.request({
				url:"http://restapi.amap.com/v3/geocode/regeo?key=58ae213b8ebbb1989b39eb59075a4212&location=武汉信息传播职业技术学院&city武汉",
				success(res) {
					console.log("访问成功",res)
					self.formatted_address=res.data.geocodes[0].formatted_address
					self.longitude=res.data.geocodes[0].longitude
					self.latitude=res.data.geocodes[0].latitude
				}
			})
		},
		data() {
			return {
				customerAddress:"",
				latitude:"",
				longitude:"",
				formatted_address:"定位中"
			}
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
